package com.example.audiodemo.endpoint;

import com.example.audiodemo.entity.SpeakDeviceDTO;
import com.example.audiodemo.service.SpeakService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/speak")
@RestController
public class SpeakController {

    @Autowired
    private SpeakService speakService;


    @PutMapping(value = "/start")
    public void start(@RequestBody SpeakDeviceDTO speakDeviceDTO) {
        speakService.start(speakDeviceDTO.getDeviceNoList());
    }

    @PutMapping(value = "/stop")
    public void stop() {
        speakService.stop();
    }

}
